﻿using System;
using FlyWebFrame.Model;

namespace FlyWebFrame.Action.admin
{
    public class deleteschedule : baseaction
    {
        public override void Treat()
        {
            int Id;
            if (!Int32.TryParse(GetParameter(0), out Id))
            {
                Redirect("/admin/schedules");
            }

            Schedule s = new Schedule();
            s.id = Id;
            s.Delete();
            admin_script += "$('#msg-newsdelete').removeClass('hidden');";
            Redirect("/admin/schedules");
        }
    }
}